﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity.Model;
using BLL;
using SystemFrameWork;

namespace DutyWeb.UserControls
{
    public partial class BaseUserControl : System.Web.UI.UserControl
    {
        protected BasePage MyBasePage = new BasePage();

        /// <summary>
        /// 
        /// </summary>
        protected string FileUplodePath
        {
            get
            {
                return Server.MapPath(string.Format("~/{0}", ConfigurationHelper.FileUplodePath));
            }
        }

        /// <summary>
        /// extract the relative url dynamicly
        /// </summary>
        /// <returns></returns>
        protected string GetBaseUrl()
        {
            string strApp = HttpContext.Current.Request.ApplicationPath;
            if (strApp == "/")
            {
                strApp = "";
            }
            return string.Format("{0}://{1}{2}", HttpContext.Current.Request.Url.Scheme.ToString(), HttpContext.Current.Request.Url.Authority.ToString(), strApp);
        }

        /// <summary>
        /// 
        /// </summary>
        protected string FileUploadRelativePath
        {
            get
            {
                return ConfigurationHelper.FileUplodePath;
            }
        }
    }
}